<template>
  <div class="app-container" ref="appcontainer">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain size="mini" @click="handleAdd"
          >新增</el-button
        >
      </el-col>
    </el-row>
    <el-table v-loading="loading" :height="tableHeight" :data="list">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="id" align="center" prop="id" />
      <el-table-column label="地址" align="center" prop="location" />

      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="handleEdit(scope.row)"
            >修改</el-button
          >

          <el-button size="mini" type="text" @click="handleDelete(scope.row.id)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <el-dialog
      :title="title"
      :visible.sync="handDialogVisible"
      width="30%"
      @close="handleClose"

    >
      
    </el-dialog>
  </div>
</template>
<script>
import { getList } from "@/api/store/saleroom";
export default {
  data() {
    return {
      list: [],
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      total: 0,
      loading: true,
    };
  },
  methods: {
    getList() {
      this.loading = true
      getList(this.queryParams)
      .then((res) => {
        this.list = res.rows;
        this.total = res.total;
      })
      .finally(() => {
        this.loading = false;
      });
    },
    handleClose() {}
  },
  mounted() {
    this.getList()
  },
};
</script>